module;
#include <condition_variable>
#include <mutex>
#include <chrono>

export module Code_4_3_3;

std::condition_variable cv;
bool done;
std::mutex m;
bool wait_loop()
{
    auto const timeout = std::chrono::steady_clock::now() + std::chrono::milliseconds(500);
    std::unique_lock<std::mutex> lk(m);
    while (!done)
    {
        if (cv.wait_until(lk, timeout) == std::cv_status::timeout)
            break;
    }
    return done;
}

export
namespace Code_4_3_3 {

    void run_thread()
    {

    }
}
